<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:84:"F:\phpstudy_pro\WWW\www.danganguanli.com\public/../wcapps/admin\view\admin\pass.html";i:1623752946;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>
            密码修改
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link href="/static/skin/nei.css" type="text/css" rel="stylesheet">
    </head>
</head>
<body onLoad="initPage()">
<div id="LoadingBar"><img src="/static/images/load.gif" /></div>
<div class="contaiter">
	<form class="layui-form layui-form-pane">
      <div class="layui-form-item">
        <label class="layui-form-label">账号</label>
        <div class="layui-input-inline">
          <input type="text" name="name" value="<?php echo $name; ?>" disabled placeholder="请输入" autocomplete="off" readonly class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">原密码</label>
        <div class="layui-input-inline">
          <input type="password" name="pass1" id="pass1" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">请输入旧密码</div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">新密码</label>
        <div class="layui-input-inline">
          <input type="password" name="pass2" id="pass2" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">请输入新密码</div>
      </div>
      <div class="layui-form-item">
        <button class="layui-btn layui-btn-green" lay-submit=""  lay-filter="go" >修改密码</button>
      </div>
    </form>
</div>
<script src="/static/js/jquery-1.10.2.min.js" type="application/javascript"></script>
<script src="/static/js/neijqtab.js" type="application/javascript"></script>
<script src="/static/js/layui/layui.js" charset="utf-8"></script>
<script>
function initPage(){
	var objLoading = document.getElementById("LoadingBar");
	if (objLoading != null){
		objLoading.style.display = "none";
		$(".contaiter").css("display","block");
	}
}
</script>
<script>
  layui.use(['form'], function(){
    var form = layui.form()
    ,layer = layui.layer
    //监听提交
    form.on('submit(go)', function(data){
        var loading2 = layer.load();
        $.ajax({
            url:'<?php echo url("admin/admin/Mypass"); ?>',
            type:"POST",
            data:{name:data.field.name,pass1:data.field.pass1,pass2:data.field.pass2},
            dataType:"",
            success:function(json){
              //alert(json);
              layer.close(loading2);
              if(json==1){
                  parent.window.location.href='<?php echo url("admin/login/login"); ?>';
                  var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                  parent.layer.close(index);
              }else{
                 layer.alert("您的旧密码错误，请重新输入！",{time:1000});
              }
            },
            error:function(res){
              alert("AJAX错误");
            }
        });
        return false;
    });
  });
</script>
</body>
</html>